<?php
define('IN_TG','member_photo');
define('IN_JS',true);
define('SCRIPT','member_photo');
session_start();
require('includes/common.inc.php');
//加载头部文件
require('header.php');
//判断是否登录了
_check_login();
//分页
$sql_count = "select count(tg_id) from tg_photo where tg_username='{$_SESSION['username']}'";
$res=_query($sql_count);

$sql = "select tg_id,tg_name,tg_url,tg_date,tg_content from tg_photo where tg_username='{$_SESSION['username']}'";
$size = $_system['photo'];
_page($sql,$size);
$sql .= " limit $_pagenum,$size";
$reres = _query($sql);
?>
    <div id="member">
    <?php
    require ("includes/member.inc.php");
    ?>
        <div id="member_main">
        <h2>个人相册</h2>
            <table cellspacing="1">
                <tr>
                    <th>ID</th>
                    <th>图片名称</th>
                    <th>描述</th>
                    <th>上传时间</th>
                    <th>图片</th>
                </tr>
                <?php while($row = _fetch_array_list($reres)):?>
                    <tr>
                        <td><?php echo $row['tg_id']?></td>
                        <td><?php echo $row['tg_name']?></td>
                        <td><?php echo _title($row['tg_content'],20);?></td>
                        <td><?php echo $row['tg_date'];?></td>
                        <td><a href="photo_detail.php?id=<?php  echo $row['tg_id'];?>"><img src="<?php echo $row['tg_url'];?>" width="70" height="70"> </a></td>
                    </tr>
                <?php endwhile;?>
               </table>
            <div id="page_num"><?php _paging(1);?></div>
    </div>

<?php
require('includes/footer.inc.php');
?>